<script setup lang="ts">
import { onLaunch, onShow, onHide } from '@dcloudio/uni-app'
import { loginOverdueToPage } from './utils'
import { SETTING } from './config'

const userStore = useUserStore()

onLaunch(() => {
  console.log('App Launch')
})

onShow(() => {
  console.log('App Show')

  // 发现未登录时跳转登录页
  if (SETTING.HAS_LOGIN && !userStore.token) {
    loginOverdueToPage()
  }
})

onHide(() => {
  console.log('App Hide')
})
</script>
<style></style>
